import socket

sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
sock.bind(('', 50002))
sock.listen(5)

while True:
  connfd, address = sock.accept()
  print "Receive connect from", address
	
	#Read data
  while True:
    buff = connfd.recv(8192)
    if len(buff) > 0:
      #print repr(buff)
			print ''.join(['\\x%02x' % ord(x) for x in buff])
    else:
      break
  connfd.close()
